package com.ease.core.events {
   import flash.events.Event;

   [Response(name="{RETURN_ID}", type="com.ease.framework.CommandCompletionEvent")]
	public class PerspectiveEvent extends Event {
      public static const REQUEST_ID:String = "PerspectiveEvent_Request";
      public static const RETURN_ID:String = "PerspectiveEvent_Return";

      public static const TYPE_OPEN:String = "openPerspective";
		public static const TYPE_OPENED:String = "perspectiveOpened";

		private var _perspectiveId:String;
      private var _spec:Object;
      private var _actionType:String;

		public function PerspectiveEvent(perspectiveId:String, spec:Object,
                                       actionType:String = TYPE_OPEN, type:String = null) {
         var typeId:String = type;
         if( type == null ) {
            typeId = REQUEST_ID;
         }
         super(typeId);
         _perspectiveId = perspectiveId;
         _spec = spec;
         _actionType = actionType;
		}

      public override function clone():Event {
         var result:PerspectiveEvent = new PerspectiveEvent(perspectiveId, spec, actionType, type);
         return result;
      }

      public function get perspectiveId():String {
         return _perspectiveId;
      }

      public function get spec():Object {
         return _spec;
      }

      public function get actionType():String {
         return _actionType;
      }
	}
}